/* ==========================================================================
   SWITCH ERP — Enterprise SaaS Dashboard
   Pure HTML + CSS | 8px grid | RTL/LTR ready
   ========================================================================== */

/* --- Design Tokens --- */
:root {
  /* Brand gradients */
  --gradient-primary: linear-gradient(135deg, #007a93 0%, #2bb656 100%);
  --gradient-secondary: linear-gradient(135deg, #112a66 0%, #00a3a6 100%);
  --gradient-premium: linear-gradient(135deg, #112a66 0%, #007a93 40%, #00a3a6 70%, #2bb656 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(17, 42, 102, 0.06) 0%, rgba(0, 122, 147, 0.04) 50%, rgba(43, 182, 86, 0.06) 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  --gradient-danger: linear-gradient(135deg, #dc2626 0%, #f97316 100%);

  /* Colors */
  --color-navy: #112a66;
  --color-teal: #007a93;
  --color-cyan: #00a3a6;
  --color-green: #2bb656;

  --surface-base: #fafbfc;
  --surface-raised: #ffffff;
  --surface-sunken: #f4f6f8;

  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;

  --border-default: #e2e8f0;
  --border-strong: #cbd5e1;

  --success-bg: #ecfdf5;
  --success-text: #059669;
  --warning-bg: #fffbeb;
  --warning-text: #d97706;
  --danger-bg: #fef2f2;
  --danger-text: #dc2626;
  --info-bg: #eff6ff;
  --info-text: #2563eb;

  /* Spacing (8px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-primary: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 122, 147, 0.15);

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --content-max: 1440px;

  /* Sidebar — gradient-blended surfaces */
  --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f9fbfc 42%, #f2f8f5 100%);
  --sidebar-glow: radial-gradient(ellipse 140% 90% at -10% -5%, rgba(0, 122, 147, 0.1) 0%, transparent 55%),
                  radial-gradient(ellipse 100% 70% at 110% 105%, rgba(43, 182, 86, 0.08) 0%, transparent 50%);
  --sidebar-divider: linear-gradient(90deg, transparent 0%, rgba(0, 122, 147, 0.18) 30%, rgba(43, 182, 86, 0.18) 70%, transparent 100%);
  --sidebar-icon-hover: rgba(0, 122, 147, 0.1);
  --sidebar-icon-active-shadow: 0 2px 10px rgba(0, 122, 147, 0.35);

  /* Typography */
  --font-en: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", ui-sans-serif, system-ui, sans-serif;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-en);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface-base);
  -webkit-font-smoothing: antialiased;
}

[dir="rtl"] body {
  font-family: var(--font-ar);
  line-height: 1.55;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* --- i18n: JS-driven locale (see app.js) --- */
.locale-toggle__btn {
  border: none;
  background: transparent;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s, font-weight 0.15s;
  font-family: inherit;
}

.locale-toggle__btn:hover {
  color: var(--color-teal);
}

.locale-toggle__btn--active {
  color: var(--color-navy);
  font-weight: 600;
}

[dir="rtl"] .kpi-card__value {
  font-family: var(--font-ar);
}

/* Placeholder i18n — single input with data-placeholder-en/ar */
.topbar__search-input--rtl,
.table-search__input--rtl,
.users-search__input--rtl {
  display: none;
}

[dir="rtl"] .topbar__search-input--ltr,
[dir="rtl"] .table-search__input--ltr,
[dir="rtl"] .users-search__input--ltr {
  display: none;
}

[dir="rtl"] .topbar__search-input--rtl,
[dir="rtl"] .table-search__input--rtl,
[dir="rtl"] .users-search__input--rtl {
  display: block;
}

/* --- Utilities --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.text-warning {
  color: var(--warning-text);
  font-weight: 500;
}

.text-danger {
  color: var(--danger-text);
  font-weight: 500;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

.icon--xs {
  width: 12px;
  height: 12px;
}

[dir="rtl"] .icon--rtl-flip {
  transform: scaleX(-1);
}

/* --- App Layout --- */
.app {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  min-width: 0;
  margin-inline-start: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
  max-width: var(--content-max);
  width: 100%;
  margin-inline: auto;
  padding: var(--space-8) var(--space-6);
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-inline-end: none;
  box-shadow: 4px 0 28px rgba(17, 42, 102, 0.06);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  isolation: isolate;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sidebar-glow);
  pointer-events: none;
  z-index: 0;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--gradient-premium);
  z-index: 2;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--topbar-height);
  padding-inline: var(--space-5);
  border-bottom: none;
  flex-shrink: 0;
  position: relative;
}

.sidebar__brand::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline: var(--space-4);
  height: 1px;
  background: var(--sidebar-divider);
}

.logo {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--gradient-subtle);
  box-shadow: inset 0 0 0 1px rgba(0, 122, 147, 0.12);
}

.logo__circle {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(17, 42, 102, 0.15);
}

.logo__circle--green  { top: 4px;  inset-inline-start: 4px;  background: #2bb656; }
.logo__circle--teal   { top: 4px;  inset-inline-end: 4px;   background: #007a93; }
.logo__circle--cyan   { bottom: 4px; inset-inline-start: 4px; background: #00a3a6; }
.logo__circle--navy   { bottom: 4px; inset-inline-end: 4px;  background: #112a66; }

.sidebar__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.sidebar__brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar__brand-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-teal);
  opacity: 0.85;
}

.sidebar__org {
  padding: var(--space-3) var(--space-4);
  border-bottom: none;
  flex-shrink: 0;
}

.sidebar__org::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: var(--space-3);
  background: var(--sidebar-divider);
}

.org-badge {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 249, 247, 0.95) 100%);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  box-shadow: inset 0 0 0 1px rgba(0, 122, 147, 0.14),
              0 2px 8px rgba(17, 42, 102, 0.04);
}

.org-badge:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(232, 247, 243, 1) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 163, 166, 0.28),
              0 4px 14px rgba(0, 122, 147, 0.1);
  transform: translateY(-1px);
}

.org-badge__info {
  flex: 1;
  min-width: 0;
}

.org-badge__name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-badge__db {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-badge__chevron {
  color: var(--color-teal);
  opacity: 0.7;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-3);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 122, 147, 0.25) transparent;
}

.sidebar__nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar__nav::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 122, 147, 0.35), rgba(43, 182, 86, 0.35));
  border-radius: var(--radius-full);
}

.sidebar__section-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-inline: var(--space-3);
  margin-bottom: var(--space-2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-teal);
  opacity: 0.75;
}

.sidebar__section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 122, 147, 0.2), transparent);
}

[dir="rtl"] .sidebar__section-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}

[dir="rtl"] .sidebar__section-label::after {
  background: linear-gradient(270deg, rgba(0, 122, 147, 0.2), transparent);
}

.nav-list {
  margin-bottom: var(--space-4);
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px var(--space-3);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.nav-link > .icon:first-of-type {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.65);
  color: var(--text-primary);
}

.nav-link:hover > .icon:first-of-type {
  background: var(--sidebar-icon-hover);
  color: var(--color-teal);
}

.nav-link--active {
  background: var(--gradient-subtle);
  color: var(--color-navy);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(0, 122, 147, 0.1),
              var(--shadow-sm);
}

.nav-link--active > .icon:first-of-type {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--sidebar-icon-active-shadow);
}

.nav-link--active::before {
  content: "";
  position: absolute;
  inset-block: 8px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: var(--radius-full);
  background: var(--gradient-premium);
}

.nav-link--group .nav-link__chevron {
  margin-inline-start: auto;
  color: var(--text-tertiary);
  transition: transform 0.25s ease, color 0.2s;
}

.nav-link--group:hover .nav-link__chevron {
  color: var(--color-teal);
}

/* Collapsible nav group (<details>) */
.nav-details {
  display: block;
}

.nav-details > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.nav-details > summary::-webkit-details-marker {
  display: none;
}

.nav-details > summary::marker {
  content: "";
}

.nav-details[open] > summary .nav-link__chevron {
  transform: rotate(180deg);
  color: var(--color-teal);
}

.nav-details[open] > summary {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-primary);
}

.nav-details > summary:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.nav-sublist {
  position: relative;
  margin-block: 4px 2px;
  margin-inline-start: 22px;
  padding-inline-start: 14px;
  border-inline-start: 2px solid transparent;
  border-image: linear-gradient(180deg, rgba(0, 122, 147, 0.35) 0%, rgba(43, 182, 86, 0.2) 100%) 1;
}

.nav-sublink {
  display: block;
  padding: 7px var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s, padding-inline-start 0.2s;
}

.nav-sublink:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--color-teal);
  padding-inline-start: calc(var(--space-3) + 2px);
}

.nav-sublink--active {
  background: var(--gradient-subtle);
  color: var(--color-navy);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(0, 122, 147, 0.12);
}

.nav-list--flat {
  margin-bottom: 0;
}

.nav-list--flat > li + li {
  margin-top: 2px;
}

.sidebar__utility {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-3) var(--space-3);
  background: linear-gradient(180deg, transparent 0%, rgba(240, 249, 247, 0.45) 100%);
}

.sidebar__utility::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: var(--space-3);
  background: var(--sidebar-divider);
}

.sidebar__footer {
  padding: var(--space-3);
  padding-top: 0;
  border-top: none;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(240, 249, 247, 0.45) 0%, rgba(240, 249, 247, 0.85) 100%);
}

.sidebar__footer::before {
  display: none;
}

.sidebar__social-label {
  margin: 0 0 var(--space-2);
  padding-inline: var(--space-1);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.sidebar__social-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-inline: var(--space-1);
}

.sidebar__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.sidebar__social-link:hover {
  color: var(--color-teal);
  border-color: rgba(0, 122, 147, 0.3);
  background: #fff;
  transform: translateY(-1px);
}

.sidebar__support {
  margin-top: var(--space-3);
  margin-bottom: 0;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--gradient-secondary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(17, 42, 102, 0.2);
  position: relative;
  overflow: hidden;
}

.sidebar__support::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(43, 182, 86, 0.35) 0%, transparent 55%);
  pointer-events: none;
}

.sidebar__support-title {
  position: relative;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.sidebar__support-sub {
  position: relative;
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: var(--space-3);
}

.sidebar__support-links {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar__support-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  transition: opacity 0.15s;
}

.sidebar__support-link:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sidebar__support-link .icon {
  opacity: 0.85;
}

.help-page {
  display: flex;
  justify-content: center;
  padding-top: var(--space-2);
}

.support-card--page {
  width: 100%;
  max-width: 440px;
  margin-top: 0;
  padding: var(--space-6);
}

.support-card--page .sidebar__support-title {
  font-size: 20px;
  margin-bottom: var(--space-1);
}

.support-card--page .sidebar__support-sub {
  font-size: 14px;
  margin-bottom: var(--space-5);
}

.support-card--page .sidebar__support-link {
  font-size: 14px;
}

.nav-link--footer {
  padding-block: var(--space-2);
}

.nav-link--footer > .icon:first-of-type {
  width: 18px;
  height: 18px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.nav-link--footer:hover > .icon:first-of-type {
  background: transparent;
  color: var(--color-teal);
}

/* --- Avatar --- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.avatar--gradient {
  background: var(--gradient-primary);
}

.avatar--gradient-secondary {
  background: var(--gradient-secondary);
}

.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.org-badge .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
  background: var(--gradient-premium);
  box-shadow: 0 2px 8px rgba(0, 122, 147, 0.3);
}

/* --- Top Bar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--topbar-height);
  padding-inline: var(--space-4);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
}

.topbar__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
}

.topbar__menu-btn:hover {
  background: var(--surface-sunken);
}

.breadcrumb {
  display: none;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  flex-shrink: 0;
}

.breadcrumb__item {
  color: var(--text-secondary);
}

.breadcrumb__item--current {
  color: var(--text-primary);
  font-weight: 500;
}

.breadcrumb__sep {
  color: var(--text-tertiary);
}

.topbar__search-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.topbar__search-group .notifications-menu {
  flex-shrink: 0;
}

.topbar__search {
  position: relative;
  flex: 1;
  max-width: 480px;
  min-width: 0;
}

.topbar__search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  inset-inline-start: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.topbar__search-input {
  width: 100%;
  height: 40px;
  padding-inline: 40px 48px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.topbar__search-input::placeholder {
  color: var(--text-tertiary);
}

.topbar__search-input:hover {
  border-color: var(--border-default);
}

.topbar__search-input:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--surface-raised);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--color-teal);
}

.topbar__search-kbd {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  inset-inline-end: 12px;
  padding: 2px 6px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--surface-raised);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  margin-inline-start: auto;
}

.locale-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding-inline: 10px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--surface-raised);
  font-size: 12px;
  font-weight: 500;
}

.locale-toggle__label {
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s, font-weight 0.15s;
  padding: 2px 4px;
  border-radius: 4px;
}

.locale-toggle__label:hover {
  color: var(--color-teal);
}

html[lang="en"] .locale-toggle__btn[data-locale="en"],
html[lang="ar"] .locale-toggle__btn[data-locale="ar"],
html[lang="en"] .locale-toggle__label[for="locale-en"],
html[lang="ar"] .locale-toggle__label[for="locale-ar"] {
  color: var(--color-navy);
  font-weight: 600;
}

.locale-toggle__sep {
  color: var(--text-tertiary);
  pointer-events: none;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--surface-sunken);
  color: var(--text-primary);
}

.icon-btn__badge {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding-inline: 4px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
}

.icon-btn--ghost {
  width: 32px;
  height: 32px;
}

.profile-btn {
  display: none;
  align-items: center;
  gap: var(--space-2);
  height: 36px;
  padding-inline: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  list-style: none;
  user-select: none;
}

.profile-btn::-webkit-details-marker {
  display: none;
}

.profile-btn::marker {
  content: "";
}

.profile-menu {
  position: relative;
}

.profile-menu__details > summary {
  list-style: none;
}

.profile-menu__details[open] > summary .profile-btn__chevron {
  transform: rotate(180deg);
}

.profile-menu__details[open] > summary.profile-btn {
  border-color: rgba(0, 122, 147, 0.35);
  background: var(--gradient-subtle);
}

.profile-btn__chevron {
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}

.profile-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 200;
  min-width: 200px;
  padding: var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  animation: profile-menu-in 0.15s ease;
}

@keyframes profile-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-menu__user {
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--space-1);
}

.profile-menu__name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-menu__email {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.profile-menu__action {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 10px var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.profile-menu__action:hover {
  background: var(--surface-sunken);
  color: var(--text-primary);
}

.profile-menu__action--logout {
  color: var(--danger-text);
}

.profile-menu__action--logout:hover {
  background: var(--danger-bg);
  color: #b91c1c;
}

/* --- Notifications dropdown --- */
.notifications-menu {
  position: relative;
}

.notifications-menu__details > summary {
  list-style: none;
}

.notifications-menu__trigger::-webkit-details-marker {
  display: none;
}

.notifications-menu__trigger::marker {
  content: "";
}

.notifications-menu__details[open] > summary.notifications-menu__trigger {
  background: var(--surface-sunken);
  color: var(--text-primary);
}

.notifications-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 200;
  width: 320px;
  max-width: calc(100vw - 24px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  animation: profile-menu-in 0.15s ease;
  overflow: hidden;
}

.notifications-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
}

.notifications-menu__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.notifications-menu__mark-all {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-teal);
  cursor: pointer;
  white-space: nowrap;
}

.notifications-menu__mark-all:hover {
  text-decoration: underline;
}

.notifications-menu__list {
  list-style: none;
  margin: 0;
  padding: var(--space-1) 0;
  max-height: 280px;
  overflow-y: auto;
}

.notifications-menu__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  transition: background 0.15s;
}

.notifications-menu__item:hover {
  background: var(--surface-sunken);
}

.notifications-menu__item--unread {
  background: rgba(0, 122, 147, 0.04);
}

.notifications-menu__item--unread:hover {
  background: rgba(0, 122, 147, 0.08);
}

.notifications-menu__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: var(--radius-full);
  background: var(--color-teal);
}

.notifications-menu__item:not(.notifications-menu__item--unread) .notifications-menu__dot {
  visibility: hidden;
}

.notifications-menu__body {
  min-width: 0;
  flex: 1;
}

.notifications-menu__text {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-primary);
}

.notifications-menu__time {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-style: normal;
}

.profile-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-sunken);
}

.profile-btn__name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
}

/* --- Page Header --- */
.page-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.page-header__title {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.page-header__subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding-inline: var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--color-teal);
}

.btn--primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 8px 20px rgba(0, 122, 147, 0.2);
}

.btn--primary:active {
  transform: translateY(0) scale(0.98);
}

.btn--secondary {
  background: var(--surface-raised);
  color: var(--color-navy);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
}

.btn--secondary:hover {
  background: var(--surface-sunken);
  border-color: var(--border-strong);
}

.btn--outline {
  background: var(--surface-raised);
  color: var(--color-navy);
  border: 1px solid var(--border-default);
}

.btn--outline:hover {
  border-color: rgba(0, 122, 147, 0.3);
  background: var(--gradient-subtle);
}

.btn--download {
  background: var(--gradient-secondary);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(17, 42, 102, 0.2);
}

.btn--download:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(17, 42, 102, 0.28);
}

.btn--bulk {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn--bulk:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

.btn--full {
  width: 100%;
}

.btn--action {
  justify-content: flex-start;
  height: 44px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-teal);
  transition: opacity 0.15s;
}

.link-btn:hover {
  opacity: 0.8;
}

/* --- Cards --- */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card--kpi {
  position: relative;
  overflow: hidden;
}

.card--kpi::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: transparent;
}

.card--kpi-primary::before {
  background: var(--gradient-premium);
}

.card--kpi {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  transition: box-shadow 0.2s;
}

.card--kpi:hover {
  box-shadow: var(--shadow-md);
}

.card--panel {
  transition: box-shadow 0.2s, border-color 0.2s;
}

.card--panel:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 122, 147, 0.15);
}

.card--widget {
  padding: var(--space-5);
}

.card--table {
  overflow: hidden;
}

/* --- KPI Cards --- */
.kpi-card__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.kpi-card__value {
  margin-top: var(--space-1);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi-card__trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: var(--space-2);
  font-size: 12px;
  font-weight: 500;
}

.kpi-card__trend--up {
  color: var(--success-text);
}

.kpi-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  color: #fff;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.kpi-card__icon--primary  { background: var(--gradient-primary); }
.kpi-card__icon--warning  { background: var(--gradient-warning); }
.kpi-card__icon--danger   { background: var(--gradient-danger); }
.kpi-card__icon--success  { background: var(--gradient-primary); }

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

/* --- Dashboard Grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.analytics-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.widgets-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.widget-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* --- Analytics Panels --- */
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) var(--space-3);
}

.panel-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.panel-header__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-subtle);
  color: var(--color-teal);
}

.panel-header__title {
  font-size: 16px;
  font-weight: 600;
}

.panel-header__meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.stacked-bar {
  display: flex;
  height: 12px;
  margin-inline: var(--space-5);
  border-radius: var(--radius-full);
  background: var(--surface-sunken);
  overflow: hidden;
}

.stacked-bar__seg {
  width: var(--w);
  background: var(--c);
  transition: width 0.5s ease;
}

.stacked-bar__seg:first-child {
  border-start-start-radius: var(--radius-full);
  border-end-start-radius: var(--radius-full);
}

.stacked-bar__seg:last-child {
  border-start-end-radius: var(--radius-full);
  border-end-end-radius: var(--radius-full);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) var(--space-5) var(--space-4);
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend__item strong {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.panel-section-label {
  padding-inline: var(--space-5);
  margin-bottom: var(--space-2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

[dir="rtl"] .panel-section-label {
  text-transform: none;
  font-size: 12px;
}

.urgency-list {
  padding-inline: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.urgency-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface-sunken);
  transition: border-color 0.15s;
}

.urgency-row:hover {
  border-color: var(--border-default);
}

.urgency-row--critical {
  background: rgba(254, 242, 242, 0.6);
}

.urgency-row--critical:hover {
  border-color: rgba(220, 38, 38, 0.2);
}

.urgency-row--warning {
  background: rgba(255, 251, 235, 0.6);
}

.urgency-row--warning:hover {
  border-color: rgba(217, 119, 6, 0.2);
}

.urgency-row div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.urgency-row strong {
  font-size: 14px;
  font-weight: 500;
}

.urgency-row span {
  font-size: 12px;
  color: var(--text-secondary);
}

.panel-footer {
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-top: 1px solid var(--border-default);
  margin-top: var(--space-4);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge--success { background: var(--success-bg); color: var(--success-text); }
.badge--success .badge__dot { background: var(--success-text); }

.badge--warning { background: var(--warning-bg); color: var(--warning-text); }
.badge--warning .badge__dot { background: var(--warning-text); }

.badge--danger  { background: var(--danger-bg);  color: var(--danger-text); }
.badge--danger  .badge__dot { background: var(--danger-text); }

.badge--neutral { background: var(--surface-sunken); color: var(--text-secondary); }
.badge--neutral .badge__dot { background: var(--text-tertiary); }

/* --- Activity Feed --- */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: 10px;
  transition: background 0.15s;
}

.activity-item:hover {
  background: var(--surface-sunken);
}

.activity-item p {
  font-size: 14px;
  line-height: 1.4;
}

.activity-item time {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.activity-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
}

.activity-item__icon--success { background: var(--success-bg); color: var(--success-text); }
.activity-item__icon--info    { background: var(--info-bg);    color: var(--info-text); }
.activity-item__icon--warning { background: var(--warning-bg); color: var(--warning-text); }
.activity-item__icon--neutral { background: var(--surface-sunken); color: var(--text-secondary); }

/* --- Data Table --- */
.table-section__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.table-section__title {
  font-size: 20px;
  font-weight: 600;
}

.table-section__subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.table-section__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.table-search {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.table-search .icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  inset-inline-start: 12px;
  color: var(--text-tertiary);
  pointer-events: none;
  z-index: 1;
}

.table-search__input {
  width: 100%;
  height: 40px;
  padding-inline: 36px var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.table-search__input:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--color-teal);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead {
  background: var(--surface-sunken);
}

.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: start;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 1px solid var(--border-default);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.12s;
}

.data-table tbody tr:hover {
  background: var(--surface-base);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--color-teal);
  cursor: pointer;
}

.table-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.table-user__name {
  display: block;
  font-weight: 500;
  white-space: nowrap;
}

.table-user__meta {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
}

.table-doc {
  font-weight: 500;
}

.table-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-default);
}

.table-footer__info {
  font-size: 13px;
  color: var(--text-secondary);
}

.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding-inline: var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pagination__btn:hover:not(:disabled) {
  background: var(--surface-sunken);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination__btn--active {
  background: var(--gradient-secondary);
  border-color: transparent;
  color: #fff;
}

.pagination__btn--active:hover {
  background: var(--gradient-secondary);
  color: #fff;
}

.pagination__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--color-teal);
}

/* --- Responsive: Tablet (768px+) --- */
@media (min-width: 768px) {
  .page-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .table-section__header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .table-footer {
    flex-direction: row;
    justify-content: space-between;
  }

  .breadcrumb {
    display: flex;
  }

  .profile-btn {
    display: inline-flex;
  }

  .profile-menu {
    display: block;
  }
}

/* --- Responsive: Desktop (1024px+) --- */
@media (min-width: 1024px) {
  .topbar {
    padding-inline: var(--space-6);
    gap: var(--space-4);
  }

  .topbar__menu-btn {
    display: none !important;
  }

  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr 340px;
  }
}

/* --- Mobile nav toggle (CSS-only) --- */
.nav-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }

  .nav-toggle:checked ~ .sidebar {
    transform: translateX(0);
  }

  [dir="rtl"] .nav-toggle:checked ~ .sidebar {
    transform: translateX(0);
  }

  .nav-toggle:checked ~ .sidebar-overlay {
    display: block;
  }
}

/* ==========================================================================
   Dashboard — Ad banner (carousel)
   ========================================================================== */
.dash-ad {
  flex-shrink: 0;
  width: 100%;
  padding: var(--space-3) var(--space-6);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-default);
}

.dash-ad__inner {
  position: relative;
  display: flex;
  align-items: stretch;
  max-width: var(--content-max);
  margin-inline: auto;
  min-height: 72px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: #f4f5f7;
  overflow: hidden;
}

.dash-ad__viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.dash-ad__track {
  display: flex;
  direction: ltr;
  transition: transform 0.45s ease;
}

.dash-ad__slide {
  flex: 0 0 100%;
  min-width: 100%;
}

.dash-ad__slide-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: var(--space-4) 56px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s;
}

[dir="rtl"] .dash-ad__slide-link {
  direction: rtl;
}

.dash-ad__slide-link:hover {
  background: rgba(255, 255, 255, 0.45);
}

.dash-ad__slide-link .logo--ad {
  position: absolute;
  inset-inline-start: var(--space-6);
  flex-shrink: 0;
}

.logo--ad {
  width: 44px;
  height: 44px;
}

.logo--ad .logo__circle {
  width: 15px;
  height: 15px;
}

.dash-ad__headline {
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 600;
  color: #8a939e;
  letter-spacing: 0.01em;
  text-align: center;
}

.dash-ad__nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #b8bec6;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 0.15s, background 0.15s;
}

.dash-ad__nav:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.5);
}

.dash-ad__nav:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

.dash-ad__nav--prev {
  inset-inline-start: 4px;
}

.dash-ad__nav--next {
  inset-inline-end: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .dash-ad__track {
    transition: none;
  }
}

@media (max-width: 640px) {
  .dash-ad {
    padding: var(--space-2) var(--space-4);
  }

  .dash-ad__inner {
    min-height: 64px;
  }

  .dash-ad__slide-link {
    min-height: 64px;
    padding: var(--space-3) 44px;
  }

  .dash-ad__slide-link .logo--ad {
    inset-inline-start: var(--space-4);
    width: 36px;
    height: 36px;
  }

  .logo--ad .logo__circle {
    width: 12px;
    height: 12px;
  }

  .dash-ad__headline {
    font-size: 16px;
  }

  .dash-ad__nav {
    width: 32px;
    height: 32px;
  }
}

/* ==========================================================================
   Dashboard — Donut cards (original layout, improved)
   ========================================================================== */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  align-items: stretch;
}

.dash-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s, transform 0.2s;
}

.dash-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.dash-card::before {
  content: "";
  display: block;
  height: 3px;
  margin: calc(var(--space-6) * -1) calc(var(--space-6) * -1) var(--space-5);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--gradient-premium);
  opacity: 0.85;
}

.donut-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.donut-wrap--enhanced {
  margin-bottom: var(--space-6);
}

.donut {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.donut__center {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--surface-raised);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-navy);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

.donut__center .icon {
  width: 22px;
  height: 22px;
  color: var(--color-teal);
}

/* --- Enhanced dashboard donuts (SVG) --- */
.donut--employees,
.donut--vehicle,
.donut--document {
  width: 180px;
  height: 180px;
  background: transparent;
  box-shadow: none;
}

.donut--employees .donut__aura,
.donut--vehicle .donut__aura,
.donut--document .donut__aura {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  animation: donut-aura-pulse 4s ease-in-out infinite;
  pointer-events: none;
}

.donut--employees .donut__aura {
  background: radial-gradient(circle, rgba(0, 122, 147, 0.1) 0%, transparent 68%);
}

.donut--vehicle .donut__aura {
  background: radial-gradient(circle, rgba(220, 38, 38, 0.08) 0%, rgba(245, 158, 11, 0.06) 45%, transparent 70%);
}

.donut--document .donut__aura {
  background: radial-gradient(circle, rgba(0, 122, 147, 0.11) 0%, rgba(0, 163, 166, 0.07) 50%, transparent 72%);
}

.donut--employees .donut__svg,
.donut--vehicle .donut__svg,
.donut--document .donut__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(0deg);
  transition: transform 0.5s ease;
}

.donut--employees .donut__svg {
  filter: url(#donut-glow-employees);
}

.donut--vehicle .donut__svg {
  filter: url(#donut-glow-vehicle);
}

.donut--document .donut__svg {
  filter: url(#donut-glow-document);
}

.donut-wrap--enhanced:hover .donut--employees .donut__svg,
.donut-wrap--enhanced:hover .donut--vehicle .donut__svg,
.donut-wrap--enhanced:hover .donut--document .donut__svg {
  transform: rotate(2deg) scale(1.008);
}

.donut--employees .donut__track,
.donut--vehicle .donut__track,
.donut--document .donut__track {
  stroke: rgba(226, 232, 240, 0.9);
}

.donut--employees .donut__seg,
.donut--vehicle .donut__seg,
.donut--document .donut__seg {
  opacity: 0;
  stroke-dasharray: 0 314.16;
}

/* Employees segments */
.donut--employees .donut__seg--contract {
  stroke: #007a93;
  animation: donut-draw-contract 0.85s cubic-bezier(0.34, 1.2, 0.64, 1) 0.1s forwards;
}

.donut--employees .donut__seg--insurance {
  stroke: #2bb656;
  animation: donut-draw-insurance 0.85s cubic-bezier(0.34, 1.2, 0.64, 1) 0.25s forwards;
}

.donut--employees .donut__seg--iqama {
  stroke: #f59e0b;
  animation: donut-draw-iqama 0.85s cubic-bezier(0.34, 1.2, 0.64, 1) 0.4s forwards;
}

.donut--employees .donut__seg--passport {
  stroke: #f97316;
  animation: donut-draw-passport 0.85s cubic-bezier(0.34, 1.2, 0.64, 1) 0.55s forwards;
}

/* Vehicle segments */
.donut--vehicle .donut__seg--v-insurance {
  stroke: #dc2626;
  animation: donut-draw-v-insurance 0.8s cubic-bezier(0.34, 1.2, 0.64, 1) 0.08s forwards;
}

.donut--vehicle .donut__seg--v-operation {
  stroke: #f59e0b;
  animation: donut-draw-v-operation 0.8s cubic-bezier(0.34, 1.2, 0.64, 1) 0.18s forwards;
}

.donut--vehicle .donut__seg--v-license {
  stroke: #007a93;
  animation: donut-draw-v-license 0.8s cubic-bezier(0.34, 1.2, 0.64, 1) 0.28s forwards;
}

.donut--vehicle .donut__seg--v-permission {
  stroke: #2bb656;
  animation: donut-draw-v-permission 0.8s cubic-bezier(0.34, 1.2, 0.64, 1) 0.38s forwards;
}

.donut--vehicle .donut__seg--v-fleet {
  stroke: #00a3a6;
  animation: donut-draw-v-fleet 0.8s cubic-bezier(0.34, 1.2, 0.64, 1) 0.48s forwards;
}

.donut--vehicle .donut__seg--v-other {
  stroke: #112a66;
  animation: donut-draw-v-other 0.9s cubic-bezier(0.34, 1.2, 0.64, 1) 0.58s forwards;
}

/* Document segment */
.donut--document .donut__seg--d-main {
  stroke: #007a93;
  animation: donut-draw-d-main 1s cubic-bezier(0.34, 1.2, 0.64, 1) 0.15s forwards;
}

@keyframes donut-draw-contract {
  to { opacity: 1; stroke-dasharray: 51.1 263.1; stroke-dashoffset: 0; }
}

@keyframes donut-draw-insurance {
  to { opacity: 1; stroke-dasharray: 76.7 237.5; stroke-dashoffset: -55.1; }
}

@keyframes donut-draw-iqama {
  to { opacity: 1; stroke-dasharray: 136.3 177.9; stroke-dashoffset: -135.8; }
}

@keyframes donut-draw-passport {
  to { opacity: 1; stroke-dasharray: 34.1 280.1; stroke-dashoffset: -276.1; }
}

@keyframes donut-draw-v-insurance {
  to { opacity: 1; stroke-dasharray: 30.5 283.7; stroke-dashoffset: 0; }
}

@keyframes donut-draw-v-operation {
  to { opacity: 1; stroke-dasharray: 30.5 283.7; stroke-dashoffset: -34.5; }
}

@keyframes donut-draw-v-license {
  to { opacity: 1; stroke-dasharray: 30.5 283.7; stroke-dashoffset: -69; }
}

@keyframes donut-draw-v-permission {
  to { opacity: 1; stroke-dasharray: 30.5 283.7; stroke-dashoffset: -103.5; }
}

@keyframes donut-draw-v-fleet {
  to { opacity: 1; stroke-dasharray: 30.5 283.7; stroke-dashoffset: -138; }
}

@keyframes donut-draw-v-other {
  to { opacity: 1; stroke-dasharray: 137.5 176.7; stroke-dashoffset: -172.5; }
}

@keyframes donut-draw-d-main {
  to { opacity: 1; stroke-dasharray: 294 20.2; stroke-dashoffset: 0; }
}

.donut__center--stat {
  width: 102px;
  height: 102px;
  gap: 2px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background:
    radial-gradient(circle at 30% 25%, rgba(0, 122, 147, 0.08) 0%, transparent 55%),
    var(--surface-raised);
  box-shadow:
    0 4px 16px rgba(17, 42, 102, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: donut-center-in 0.6s ease 0.35s both;
}

.donut__value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.donut__value-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.donut__category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
}

.donut__category--employees {
  color: var(--color-teal);
}

.donut__category--vehicle {
  color: var(--color-navy);
}

.donut__category--document {
  color: var(--color-teal);
}

.donut--vehicle .donut__value {
  background: linear-gradient(135deg, #dc2626 0%, #112a66 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.donut--document .donut__value {
  background: linear-gradient(135deg, #007a93 0%, #00a3a6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.donut__category .icon {
  width: 14px;
  height: 14px;
}

@keyframes donut-center-in {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes donut-aura-pulse {
  0%, 100% {
    opacity: 0.45;
    transform: scale(1);
  }
  50% {
    opacity: 0.72;
    transform: scale(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  .donut--employees .donut__seg,
  .donut--vehicle .donut__seg,
  .donut--document .donut__seg {
    opacity: 1;
    animation: none;
  }

  .donut--employees .donut__seg--contract {
    stroke-dasharray: 51.1 263.1;
    stroke-dashoffset: 0;
  }

  .donut--employees .donut__seg--insurance {
    stroke-dasharray: 76.7 237.5;
    stroke-dashoffset: -55.1;
  }

  .donut--employees .donut__seg--iqama {
    stroke-dasharray: 136.3 177.9;
    stroke-dashoffset: -135.8;
  }

  .donut--employees .donut__seg--passport {
    stroke-dasharray: 34.1 280.1;
    stroke-dashoffset: -276.1;
  }

  .donut--vehicle .donut__seg--v-insurance {
    stroke-dasharray: 30.5 283.7;
    stroke-dashoffset: 0;
  }

  .donut--vehicle .donut__seg--v-operation {
    stroke-dasharray: 30.5 283.7;
    stroke-dashoffset: -34.5;
  }

  .donut--vehicle .donut__seg--v-license {
    stroke-dasharray: 30.5 283.7;
    stroke-dashoffset: -69;
  }

  .donut--vehicle .donut__seg--v-permission {
    stroke-dasharray: 30.5 283.7;
    stroke-dashoffset: -103.5;
  }

  .donut--vehicle .donut__seg--v-fleet {
    stroke-dasharray: 30.5 283.7;
    stroke-dashoffset: -138;
  }

  .donut--vehicle .donut__seg--v-other {
    stroke-dasharray: 137.5 176.7;
    stroke-dashoffset: -172.5;
  }

  .donut--document .donut__seg--d-main {
    stroke-dasharray: 294 20.2;
    stroke-dashoffset: 0;
  }

  .donut__center--stat,
  .donut--employees .donut__aura,
  .donut--vehicle .donut__aura,
  .donut--document .donut__aura {
    animation: none;
    opacity: 1;
  }

  .donut-wrap--enhanced:hover .donut--employees .donut__svg,
  .donut-wrap--enhanced:hover .donut--vehicle .donut__svg,
  .donut-wrap--enhanced:hover .donut--document .donut__svg {
    transform: none;
  }
}

.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  justify-content: center;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-default);
}

.dash-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.dash-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.renewal-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-4);
  list-style: none;
}

.renewal-group {
  list-style: none;
}

.renewal-details {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.renewal-details > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.renewal-details > summary::-webkit-details-marker {
  display: none;
}

.renewal-details > summary::marker {
  content: "";
}

.renewal-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  transition: background 0.15s;
}

.renewal-details > summary:hover .renewal-list__item,
.renewal-details[open] > summary .renewal-list__item {
  background: var(--surface-sunken);
}

.renewal-details[open] > summary .renewal-list__chevron {
  transform: rotate(180deg);
  color: var(--color-teal);
}

.renewal-list__label {
  flex: 1;
  min-width: 0;
  font-weight: 500;
}

.renewal-list__count {
  font-weight: 600;
  color: var(--color-navy);
  font-variant-numeric: tabular-nums;
  min-width: 20px;
  text-align: end;
}

.renewal-list__chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.25s ease, color 0.2s;
}

.renewal-files {
  list-style: none;
  margin: 0;
  padding: 4px 0 6px;
  background: rgba(255, 255, 255, 0.6);
  border-inline-start: 2px solid rgba(0, 122, 147, 0.2);
  margin-inline-start: var(--space-3);
}

.renewal-file {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px var(--space-3);
  font-size: 12px;
  transition: background 0.15s;
}

.renewal-file:hover {
  background: rgba(0, 122, 147, 0.05);
}

.renewal-file__icon {
  color: var(--color-teal);
  flex-shrink: 0;
}

.renewal-file__name {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.renewal-file__days {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--surface-sunken);
  color: var(--text-secondary);
}

.renewal-file__days--warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.renewal-file__days--danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.renewal-file__clock {
  opacity: 0.85;
}

.expire-soon {
  display: block;
  text-align: center;
  padding: var(--space-3);
  font-size: 13px;
  font-weight: 600;
  color: var(--danger-text);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}

.expire-soon:hover {
  background: var(--danger-bg);
  color: #b91c1c;
}

/* ==========================================================================
   Page layouts — Users, Leave, Quick Renewal, Forms
   ========================================================================== */
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.page-toolbar__title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-navy);
}

.page-toolbar--center {
  flex-direction: column;
  text-align: center;
  margin-bottom: var(--space-8);
}

.page-toolbar--center .page-toolbar__title {
  font-size: 26px;
}

.page-toolbar--with-back {
  align-items: center;
}

.page-toolbar--with-back .page-toolbar__title {
  flex: 1;
  min-width: 0;
}

.page-toolbar--center.page-toolbar--with-back {
  flex-direction: row;
  text-align: start;
}

.page-toolbar--center.page-toolbar--with-back .page-toolbar__title {
  text-align: center;
}

.page-toolbar--back-only {
  margin-bottom: var(--space-4);
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 36px;
  padding-inline: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.page-back:hover {
  background: var(--gradient-subtle);
  color: var(--color-teal);
  border-color: rgba(0, 122, 147, 0.25);
}

.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-8);
}

.page-tabs__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 12px var(--space-5);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.page-tabs__btn--active {
  background: var(--gradient-secondary);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.page-tabs__btn:not(.page-tabs__btn--active):hover {
  border-color: var(--color-teal);
  color: var(--color-teal);
}

.leave-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.leave-toolbar__tabs {
  margin-bottom: 0;
  justify-content: flex-start;
}

.leave-toolbar__bulk {
  flex-shrink: 0;
  margin-inline-start: auto;
}

.leave-toolbar__bulk--active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(124, 58, 237, 0.45);
}

.form-card {
  max-width: 720px;
  margin-inline: auto;
  padding: var(--space-8);
}

.form-field {
  margin-bottom: var(--space-5);
}

.form-field__label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-field__select,
.form-field__input {
  width: 100%;
  padding: 12px var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-field__select:focus,
.form-field__input:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(0, 122, 147, 0.12);
}

.entity-select {
  position: relative;
}

.entity-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: 12px var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: 14px;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.entity-select__trigger:hover {
  border-color: rgba(0, 122, 147, 0.35);
}

.entity-select--open .entity-select__trigger,
.entity-select__trigger:focus-visible {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(0, 122, 147, 0.12);
}

.entity-select__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-select__label--placeholder {
  color: var(--text-tertiary);
}

.entity-select__chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}

.entity-select--open .entity-select__chevron {
  transform: rotate(180deg);
}

.entity-select__panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  max-height: 280px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.entity-select--open .entity-select__panel {
  display: flex;
}

.entity-select__panel[hidden] {
  display: none !important;
}

.entity-select__search-wrap {
  position: relative;
  flex-shrink: 0;
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-default);
}

.entity-select__search-icon {
  position: absolute;
  top: 50%;
  inset-inline-start: calc(var(--space-3) + 10px);
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.entity-select__search {
  width: 100%;
  padding: 10px var(--space-3) 10px 36px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-base);
  font-size: 14px;
}

[dir="rtl"] .entity-select__search {
  padding: 10px 36px 10px var(--space-3);
}

.entity-select__search:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(0, 122, 147, 0.12);
}

.entity-select__list {
  flex: 1;
  margin: 0;
  padding: var(--space-2);
  list-style: none;
  overflow-y: auto;
}

.entity-select__option {
  padding: 10px var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.entity-select__option:hover,
.entity-select__option--highlight {
  background: var(--gradient-subtle);
  color: var(--color-teal);
}

.entity-select__option--selected {
  background: rgba(0, 122, 147, 0.1);
  color: var(--color-teal);
  font-weight: 500;
}

.entity-select__option[hidden] {
  display: none;
}

.entity-select__empty {
  margin: 0;
  padding: var(--space-5) var(--space-4);
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
}

textarea.form-field__input {
  min-height: 96px;
  resize: vertical;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 200px;
  padding: var(--space-8);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover {
  border-color: var(--color-teal);
  background: rgba(0, 122, 147, 0.04);
}

.upload-zone__icon {
  width: 48px;
  height: 48px;
  color: var(--color-teal);
  opacity: 0.7;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

/* --- Employee table + column filter --- */
.emp-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.emp-table-toolbar__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.emp-table-toolbar__bulk {
  flex-shrink: 0;
  margin-inline-start: auto;
}

.emp-table-toolbar__filters {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.emp-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 240px;
  flex-shrink: 0;
}

.emp-search__icon {
  position: absolute;
  inset-inline-start: 12px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.emp-search__input {
  width: 100%;
  padding: 10px var(--space-4) 10px 36px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

[dir="rtl"] .emp-search__input {
  padding: 10px 36px 10px var(--space-4);
}

.emp-search__input:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(0, 122, 147, 0.12);
}

.emp-search__input--rtl {
  display: none;
}

[dir="rtl"] .emp-search__input--ltr {
  display: none;
}

[dir="rtl"] .emp-search__input--rtl {
  display: block;
}

@media (max-width: 768px) {
  .emp-table-toolbar__main {
    width: 100%;
  }

  .emp-table-toolbar__bulk {
    width: 100%;
    margin-inline-start: 0;
    justify-content: center;
  }

  .emp-table-toolbar__filters {
    width: 100%;
  }

  .emp-search {
    width: 100%;
    flex: 1 1 100%;
  }
}

.table-wrap--wide {
  overflow-x: auto;
}

.data-table--employees,
.data-table--vehicles {
  min-width: max-content;
}

.data-table--employees th,
.data-table--employees td,
.data-table--vehicles th,
.data-table--vehicles td {
  white-space: nowrap;
}

.emp-col--hidden,
.veh-col--hidden {
  display: none;
}

.emp-col--sticky,
.veh-col--sticky {
  position: sticky;
  inset-inline-end: 0;
  z-index: 2;
  background: var(--surface-raised);
  box-shadow: -6px 0 12px rgba(15, 23, 42, 0.05);
}

.data-table--employees thead .emp-col--sticky,
.data-table--vehicles thead .veh-col--sticky {
  background: var(--surface-sunken);
}

.data-table--employees tbody tr:hover .emp-col--sticky,
.data-table--vehicles tbody tr:hover .veh-col--sticky {
  background: var(--surface-base);
}

.col-filter {
  position: relative;
}

.col-filter__details > summary {
  list-style: none;
}

.col-filter__trigger::-webkit-details-marker {
  display: none;
}

.col-filter__trigger::marker {
  content: "";
}

.col-filter__trigger {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

.col-filter__trigger:hover {
  background: transparent;
  color: var(--color-teal);
  border-color: var(--color-teal);
}

.col-filter__details[open] > summary.col-filter__trigger {
  background: transparent;
  color: var(--color-teal);
  border-color: rgba(0, 122, 147, 0.45);
}

.col-filter__panel {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 200;
  width: min(320px, calc(100vw - 32px));
  max-height: 360px;
  overflow: auto;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.col-filter__actions {
  display: flex;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-default);
}

.col-filter__action {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-teal);
  cursor: pointer;
}

.col-filter__action:hover {
  text-decoration: underline;
}

.col-filter__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

.col-filter__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 6px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}

.col-filter__item:hover {
  background: var(--surface-sunken);
}

.filter-bar__field {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.filter-bar__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.filter-bar__select {
  min-width: 180px;
  padding: 10px var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.renewal-period-bar {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(240px, 1fr) auto;
  align-items: end;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-5) var(--space-6);
  border: 1px solid rgba(0, 122, 147, 0.2);
  border-radius: var(--radius-md);
  background: var(--gradient-subtle);
  animation: profile-menu-in 0.2s ease;
}

.renewal-period-bar[hidden] {
  display: none;
}

.renewal-period-bar__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.renewal-period-bar__action {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
}

.renewal-period-bar__renew {
  min-height: 44px;
  padding-inline: var(--space-5);
  white-space: nowrap;
}

.renewal-period-bar__feedback {
  grid-column: 1 / -1;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.renewal-period-bar__feedback[hidden] {
  display: none;
}

.renewal-period-bar__feedback--error {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.renewal-period-bar__feedback--success {
  background: var(--success-bg);
  color: var(--success-text);
}

@media (max-width: 900px) {
  .renewal-period-bar {
    grid-template-columns: 1fr 1fr;
  }

  .renewal-period-bar__action {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .renewal-period-bar {
    grid-template-columns: 1fr;
  }
}

.renewal-period-bar__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-navy);
}

.renewal-period-bar__select {
  width: 100%;
  min-height: 44px;
  padding: 11px var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.renewal-period-bar__select:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(0, 122, 147, 0.12);
}

/* --- Date picker --- */
.date-picker {
  position: relative;
  width: 100%;
  min-width: 0;
}

.date-picker__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 44px;
  padding: 11px var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: 14px;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.date-picker__trigger:hover {
  border-color: rgba(0, 122, 147, 0.35);
}

.date-picker--open .date-picker__trigger,
.date-picker__trigger:focus-visible {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(0, 122, 147, 0.12);
}

.date-picker__icon {
  flex-shrink: 0;
  color: var(--color-teal);
}

.date-picker__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-picker__label--placeholder {
  color: var(--text-tertiary);
}

.date-picker__chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}

.date-picker--open .date-picker__chevron {
  transform: rotate(180deg);
}

.date-picker__panel {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 120;
  width: 300px;
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  animation: profile-menu-in 0.15s ease;
}

.date-picker__panel[hidden] {
  display: none;
}

.date-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.date-picker__month-year {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-navy);
}

.date-picker__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.date-picker__nav:hover {
  background: var(--surface-sunken);
  color: var(--text-primary);
}

.date-picker__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: var(--space-2);
}

.date-picker__weekday {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-align: center;
  padding: 4px 0;
}

.date-picker__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.date-picker__day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.date-picker__day:hover:not(:disabled) {
  background: rgba(0, 122, 147, 0.1);
}

.date-picker__day--muted {
  color: var(--text-tertiary);
}

.date-picker__day--today {
  box-shadow: inset 0 0 0 1px var(--color-teal);
}

.date-picker__day--selected {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.date-picker__day--selected:hover {
  background: var(--gradient-primary);
  color: #fff;
}

.date-picker__day:disabled {
  opacity: 0.35;
  cursor: default;
}

.data-table--simple .table-user {
  display: block;
}

.data-table--simple .table-user__name {
  font-weight: 500;
  text-transform: none;
}

.btn--action-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient-secondary);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.btn--action-row:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn--action-renewal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 108px;
  justify-content: center;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-navy);
  color: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn--action-renewal:hover {
  opacity: 0.92;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn--action-renewal .icon {
  color: #fff;
}

.btn--delete-renewal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-navy);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.btn--delete-renewal:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.renewal-detail-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-bottom: var(--space-6);
}

.renewal-detail-toolbar__back {
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-full);
}

.renewal-detail-toolbar__title {
  margin: 0;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  color: var(--color-navy);
  text-align: center;
}

.renewal-detail-form {
  margin-bottom: var(--space-5);
  padding: var(--space-6);
}

.renewal-detail-form__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4) var(--space-5);
}

.renewal-detail-form__grid .form-field {
  margin-bottom: 0;
}

.renewal-detail-form__input--readonly {
  background: var(--surface-sunken);
  color: var(--text-secondary);
  cursor: default;
}

.renewal-detail-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-default);
}

.renewal-detail-form__actions .btn--primary {
  min-width: 140px;
  padding: 12px var(--space-6);
}

.renewal-detail-form__feedback {
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}

.renewal-detail-form__feedback[hidden] {
  display: none;
}

.renewal-detail-form__feedback--success {
  background: var(--success-bg);
  color: var(--success-text);
}

.renewal-detail-form__feedback--error {
  background: var(--danger-bg);
  color: var(--danger-text);
}

#quick-renewal-list-view[hidden],
#quick-renewal-detail-view[hidden],
#veh-quick-renewal-list-view[hidden],
#veh-quick-renewal-detail-view[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .renewal-detail-form__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .renewal-detail-form__grid {
    grid-template-columns: 1fr;
  }

  .renewal-detail-toolbar__title {
    font-size: 16px;
    padding-inline: 48px;
  }
}

/* Vehicle maintenance detail view */
.veh-maint-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-bottom: var(--space-5);
}

.veh-maint-toolbar__back {
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
}

.veh-maint-toolbar__title {
  margin: 0;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  text-align: center;
}

.veh-maint-tabs {
  margin-bottom: var(--space-5);
}

.veh-maint-card {
  padding: var(--space-6);
}

.veh-maint-form__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4) var(--space-5);
}

.veh-maint-form__grid .form-field {
  margin-bottom: 0;
}

.veh-maint-form__full {
  grid-column: 1 / -1;
}

.veh-maint-form__attachment {
  grid-column: 1 / -1;
}

.veh-maint-panel[hidden] {
  display: none;
}

.veh-maint-upload {
  width: 100%;
  min-height: 180px;
}

.veh-maint-upload__icon {
  color: #7c3aed;
  opacity: 1;
}

.veh-maint-file-name {
  margin: var(--space-2) 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.veh-maint-file-name[hidden] {
  display: none;
}

.veh-maint-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.veh-maint-form__submit {
  min-width: 160px;
  padding: 12px var(--space-6);
}

.veh-maint-form__feedback {
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.veh-maint-form__feedback[hidden] {
  display: none;
}

.veh-maint-form__feedback--success {
  background: var(--success-bg);
  color: var(--success-text);
}

.veh-maint-form__feedback--error {
  background: var(--danger-bg);
  color: var(--danger-text);
}

@media (max-width: 900px) {
  .veh-maint-form__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .veh-maint-form__grid {
    grid-template-columns: 1fr;
  }

  .veh-maint-toolbar__title {
    font-size: 16px;
    padding-inline: 48px;
  }
}

.forms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.form-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  min-height: 72px;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.form-tile:hover {
  border-color: rgba(0, 122, 147, 0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.form-tile__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}

.form-tile__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  color: var(--color-teal);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.form-tile:hover .form-tile__arrow {
  background: var(--gradient-subtle);
  border-color: rgba(0, 122, 147, 0.25);
}

.users-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  min-width: 240px;
}

.users-search__input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
}

.users-search__input--rtl { display: none; }
[dir="rtl"] .users-search__input--ltr { display: none; }
[dir="rtl"] .users-search__input--rtl { display: block; }

.status-active {
  color: var(--success-text);
  font-weight: 600;
}

.status-inactive {
  color: #c62828;
  font-weight: 600;
}

.page-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn--excel {
  background: var(--surface-raised);
  color: #1b5e20;
  border: 1.5px solid #43a047;
  box-shadow: var(--shadow-sm);
}

.btn--excel:hover {
  background: #e8f5e9;
  border-color: #2e7d32;
}

.btn--view {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 34px;
  padding-inline: 0.85rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--color-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.btn--view:hover {
  filter: brightness(1.08);
}

@media (max-width: 1279px) {
  .dash-cards {
    grid-template-columns: 1fr;
  }

  .forms-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .forms-grid {
    grid-template-columns: 1fr;
  }

  .page-tabs__btn {
    min-width: 100%;
  }
}

/* --- Responsive: Mobile (<1024px) — Sidebar drawer --- */
@media (max-width: 1023px) {
  .main {
    margin-inline-start: 0;
  }

  .sidebar {
    box-shadow: 8px 0 32px rgba(17, 42, 102, 0.12);
  }

  .topbar__menu-btn {
    display: inline-flex;
  }
}

.content {
  padding: var(--space-6) var(--space-4);
}

@media (max-width: 767px) {
  .page-header__title {
    font-size: 24px;
  }

  [dir="rtl"] .page-header__title[data-en][data-ar]::before {
    font-size: 24px;
  }

  .topbar__search-kbd {
    display: none;
  }

  .locale-toggle {
    display: none;
  }

  .table-section__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .table-section__actions .btn--primary {
    width: 100%;
  }

  /* Stack table as cards on very small screens */
  .data-table thead {
    display: none;
  }

  .data-table tbody tr {
    display: block;
    position: relative;
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-default);
  }

  .data-table td:first-child {
    display: none;
  }

  .data-table tbody tr:hover {
    background: transparent;
  }

  .data-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-2) 0;
    border-bottom: none;
  }

  .data-table td:last-child {
    justify-content: flex-end;
    padding-top: var(--space-3);
  }

  .data-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    flex-shrink: 0;
  }

  .data-table td:nth-child(2)::before { content: "Employee"; }
  .data-table td:nth-child(3)::before { content: "Document"; }
  .data-table td:nth-child(4)::before { content: "Expiry"; }
  .data-table td:nth-child(5)::before { content: "Status"; }
  .data-table td:nth-child(6)::before { content: "Days left"; }

  [dir="rtl"] .data-table td:nth-child(2)::before { content: "الموظف"; }
  [dir="rtl"] .data-table td:nth-child(3)::before { content: "المستند"; }
  [dir="rtl"] .data-table td:nth-child(4)::before { content: "الانتهاء"; }
  [dir="rtl"] .data-table td:nth-child(5)::before { content: "الحالة"; }
  [dir="rtl"] .data-table td:nth-child(6)::before { content: "الأيام"; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* --- Print --- */
@media print {
  .sidebar,
  .topbar {
    display: none;
  }

  .main {
    margin-inline-start: 0;
  }
}

/* --- Settings: Company Logo --- */
.settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  align-items: start;
}

.settings-card__heading {
  margin: 0 0 var(--space-5);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.company-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 122, 147, 0.12);
}

.company-logo[hidden] {
  display: none;
}

.settings-card__title {
  margin: 0 0 var(--space-2);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.settings-card__desc {
  margin: 0 0 var(--space-6);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.logo-upload {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.logo-upload__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: var(--space-6);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
}

.logo-upload__default {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.logo--preview {
  width: 72px;
  height: 72px;
}

.logo--preview .logo__circle {
  width: 24px;
  height: 24px;
}

.logo-upload__default-label {
  font-size: 13px;
  color: var(--text-tertiary);
}

.logo-upload__img {
  max-width: 200px;
  max-height: 120px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #fff;
  padding: var(--space-2);
  box-shadow: 0 2px 12px rgba(17, 42, 102, 0.08);
}

.logo-upload__zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 120px;
  padding: var(--space-6);
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.logo-upload__zone:hover,
.logo-upload__zone--drag {
  border-color: var(--color-teal);
  background: rgba(0, 122, 147, 0.04);
}

.logo-upload__zone-icon {
  width: 28px;
  height: 28px;
  color: var(--color-teal);
}

.logo-upload__zone-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.logo-upload__zone-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.logo-upload__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.logo-upload__status {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.logo-upload__status--success {
  color: var(--color-green, #2bb656);
}

.logo-upload__status--error {
  color: #d64545;
}

.logo-upload__status--info {
  color: var(--text-secondary);
}

.settings-note {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid #f0c14b;
  border-radius: var(--radius-md);
  background: #fff8e6;
  color: #7a5a00;
  font-size: 12px;
  line-height: 1.5;
}

.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-default);
}

.settings-toggle__title {
  margin: 0 0 var(--space-1);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-toggle__desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
  cursor: pointer;
}

.switch__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c9d2e0;
  transition: background 0.2s;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 42, 102, 0.25);
  transition: transform 0.2s;
}

.switch__input:checked + .switch__track {
  background: var(--color-navy, #112a66);
}

.switch__input:checked + .switch__track::after {
  transform: translateX(20px);
}

[dir="rtl"] .switch__input:checked + .switch__track::after {
  transform: translateX(-20px);
}

.switch__input:focus-visible + .switch__track {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

.video-upload {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.video-upload__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border-radius: var(--radius-lg);
  background: #111;
  overflow: hidden;
}

.video-upload__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.video-upload__empty .icon {
  width: 36px;
  height: 36px;
}

.video-upload__video {
  display: block;
  width: 100%;
  max-height: 220px;
  background: #000;
}

@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
}

/* --- My Password page --- */
.secret-key-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 360px;
  padding-top: var(--space-8);
}

.secret-key-section[hidden],
.secret-key-section--unlocked {
  display: none !important;
}

.secret-key-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-8);
  text-align: center;
}

.secret-key-card__lock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-5);
  border-radius: var(--radius-full);
  background: var(--gradient-subtle);
  color: var(--color-teal);
  box-shadow:
    inset 0 0 0 1px rgba(0, 122, 147, 0.14),
    0 8px 24px rgba(17, 42, 102, 0.08);
}

.secret-key-card__lock-icon {
  width: 38px;
  height: 38px;
}

.secret-key-card__label {
  display: block;
  margin-bottom: var(--space-4);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-navy);
}

.secret-key-card__input {
  margin-bottom: var(--space-5);
  text-align: center;
}

.secret-key-card__submit {
  min-width: 140px;
}

.secret-key-card__message {
  margin: var(--space-4) 0 0;
  font-size: 13px;
  font-weight: 500;
}

.secret-key-card__message--error {
  color: #d64545;
}

.secret-key-card__message--success {
  color: var(--color-green, #2bb656);
}

.password-vault {
  margin-top: var(--space-2);
}

.data-table--passwords {
  min-width: max-content;
}

.data-table--passwords th,
.data-table--passwords td {
  white-space: nowrap;
}

.password-mask {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}

.password-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-teal);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.password-link__icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.password-link:hover {
  color: var(--color-navy);
  text-decoration: underline;
}

.doc-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-teal);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.doc-attachment__icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.doc-attachment:hover {
  color: var(--color-navy);
  text-decoration: underline;
}

.password-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.password-cell__text {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: var(--text-primary);
}

.password-cell__text--hidden {
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}

.password-cell__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.password-cell__toggle:hover {
  background: var(--surface-sunken);
  color: var(--color-teal);
}

.password-cell__toggle--visible {
  color: var(--color-teal);
}

.password-cell__icon--hide {
  display: none;
}

.password-cell__toggle--visible .password-cell__icon--show {
  display: none;
}

.password-cell__toggle--visible .password-cell__icon--hide {
  display: block;
}

.pwd-col--sticky {
  position: sticky;
  inset-inline-end: 0;
  z-index: 2;
  background: var(--surface-raised);
  box-shadow: -6px 0 12px rgba(15, 23, 42, 0.05);
}

.data-table--passwords thead .pwd-col--sticky {
  background: var(--surface-sunken);
}

.data-table--passwords tbody tr:hover .pwd-col--sticky {
  background: var(--surface-base);
}

/* --- Modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 42, 102, 0.45);
  backdrop-filter: blur(2px);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  animation: profile-menu-in 0.2s ease;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-default);
}

.modal__title {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-navy);
}

.modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #d64545;
  cursor: pointer;
  transition: background 0.15s;
}

.modal__close:hover {
  background: var(--danger-bg);
}

.modal__body {
  padding: var(--space-6);
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6) var(--space-6);
}

.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4) var(--space-5);
}

.modal-form-grid .form-field {
  margin-bottom: 0;
}

.modal-form-grid__full {
  grid-column: 1 / -1;
}

.modal__dialog--employee {
  max-width: 960px;
}

.modal__dialog--employee .modal__body {
  max-height: min(62vh, 520px);
  overflow-y: auto;
}

.modal__dialog--vehicle {
  max-width: 960px;
}

.modal__dialog--vehicle .modal__body {
  max-height: min(62vh, 520px);
  overflow-y: auto;
}

.form-field__input--readonly {
  background: var(--surface-sunken);
  color: var(--text-secondary);
  cursor: default;
}

.form-field__check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.form-field__check .checkbox {
  width: 18px;
  height: 18px;
}

.modal__dialog--bulk {
  max-width: 640px;
}

.bulk-register__intro {
  margin: 0 0 var(--space-6);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.bulk-register__step {
  padding: var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.bulk-register__step + .bulk-register__step {
  margin-top: var(--space-4);
}

.bulk-register__step-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.bulk-register__step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.bulk-register__step-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.bulk-register__step-desc {
  margin: var(--space-1) 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.bulk-register__download {
  width: 100%;
}

.bulk-register__upload {
  min-height: 160px;
  margin-bottom: 0;
}

.bulk-register__upload-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.bulk-register__upload--dragover {
  border-color: var(--color-teal);
  background: rgba(0, 122, 147, 0.08);
}

.bulk-register__file-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}

.bulk-register__file-name::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E") center / contain no-repeat;
  color: var(--color-teal);
}

.bulk-register__status {
  margin: var(--space-3) 0 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.bulk-register__status--error {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.bulk-register__status--success {
  background: var(--success-bg);
  color: var(--success-text);
}

@media (max-width: 768px) {
  .modal-form-grid {
    grid-template-columns: 1fr;
  }

  .modal-form-grid__full {
    grid-column: auto;
  }

  .modal-form-grid--user {
    grid-template-columns: 1fr;
  }

  .form-field--spacer {
    display: none;
  }
}

/* --- Row actions menu (table) --- */
.row-actions-menu {
  position: relative;
  display: inline-flex;
}

.row-actions-menu__details > summary {
  list-style: none;
}

.row-actions-menu__details > summary::-webkit-details-marker {
  display: none;
}

.row-actions-menu__panel {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-end: 0;
  z-index: 100;
  min-width: 120px;
  padding: var(--space-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  animation: profile-menu-in 0.15s ease;
}

.row-actions-menu__panel--fixed {
  inset-inline-end: auto;
  z-index: 1000;
}

.veh-col--sticky:has(.row-actions-menu__details[open]) {
  z-index: 20;
}

.row-actions-menu__action {
  display: block;
  width: 100%;
  padding: 10px var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: start;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.row-actions-menu__action:hover {
  background: var(--surface-sunken);
  color: var(--text-primary);
}

.row-actions-menu__action--danger {
  color: var(--danger-text);
}

.row-actions-menu__action--danger:hover {
  background: var(--danger-bg);
  color: var(--danger-text);
}

/* --- User modal --- */
.modal__dialog--user {
  max-width: 800px;
}

.modal__header--user {
  align-items: flex-start;
}

.modal__header-text {
  flex: 1;
  min-width: 0;
}

.modal__title--start {
  text-align: start;
}

.modal__subtitle {
  margin: var(--space-1) 0 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-form-grid--user {
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-6);
}

.modal-form-grid--user .form-field {
  margin-bottom: 0;
}

.form-field--spacer {
  visibility: hidden;
  pointer-events: none;
}

/* --- Menu transfer list --- */
.menu-transfer-section {
  margin-top: var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  box-shadow: var(--shadow-sm);
}

.menu-transfer-section__title {
  margin: 0 0 var(--space-2);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.menu-transfer-section__hint {
  margin: 0 0 var(--space-4);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.menu-transfer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.menu-transfer__panel {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  max-height: 280px;
  border-radius: var(--radius-md);
  background: #dceef8;
  overflow: hidden;
}

.menu-transfer__heading {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  background: rgba(255, 255, 255, 0.35);
}

.menu-transfer__list {
  flex: 1;
  margin: 0;
  padding: var(--space-3);
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.menu-transfer__list-item {
  list-style: none;
}

.menu-transfer__list-item--ghost {
  opacity: 0.35;
}

.menu-transfer__list--drag-over {
  outline: 2px dashed var(--color-teal);
  outline-offset: -4px;
  background: rgba(0, 122, 147, 0.06);
}

.menu-transfer__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.15s, transform 0.1s, opacity 0.15s;
}

.menu-transfer__item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-teal);
}

.menu-transfer__item:active {
  cursor: grabbing;
}

.menu-transfer__item--dragging {
  opacity: 0.55;
  transform: scale(0.98);
  box-shadow: var(--shadow-lg);
  cursor: grabbing;
}

.menu-transfer__handle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
}

.menu-transfer__handle .icon {
  width: 16px;
  height: 16px;
}

.menu-transfer__label {
  flex: 1;
  text-align: center;
}

@media (max-width: 640px) {
  .menu-transfer {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Login / Register — app-style card + geometric animated background
   ========================================================================== */
.login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
  overflow-x: hidden;
  overflow-y: auto;
  background: #0b1530;
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #0b1530;
}

.login-bg__canvas,
.login-bg__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  display: block;
}

.login-bg__video-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 55% 48% at 50% 48%, rgba(11, 21, 48, 0.08) 0%, rgba(11, 21, 48, 0.4) 70%, rgba(8, 14, 30, 0.58) 100%);
  pointer-events: none;
}

.login-page--custom-video .login-bg__canvas {
  opacity: 0;
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  max-width: 420px;
  margin: auto;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow:
    0 24px 64px rgba(7, 14, 40, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
  animation: login-card-in 0.55s ease;
}

.login-card--register {
  width: min(100%, 960px);
  max-width: 960px;
}

.login-card--register .login-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.login-card--register .login-card__brand {
  margin-bottom: 0;
}

.login-card--register .login-locale {
  margin-bottom: 0;
  flex-shrink: 0;
}

.register-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-5);
}

.register-form__select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

html[dir="rtl"] .register-form__select {
  background-position: left 12px center;
}

.register-form__note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 122, 147, 0.28);
  background: rgba(0, 163, 166, 0.08);
  color: var(--color-navy);
  font-size: 13px;
  line-height: 1.45;
}

.register-form__note p {
  margin: 0;
}

.register-form__note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--color-teal);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
}

.register-form__uploads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-5);
}

.signup-upload {
  display: block;
  cursor: pointer;
}

.signup-upload__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--color-navy);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.signup-upload:hover .signup-upload__btn,
.signup-upload:focus-within .signup-upload__btn {
  border-color: rgba(0, 122, 147, 0.4);
  background: var(--surface-sunken);
}

.signup-upload__btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-teal);
}

.signup-upload__label {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.signup-upload__file {
  margin-inline-start: auto;
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signup-upload--filled .signup-upload__file {
  color: var(--color-teal);
  font-weight: 600;
}

.register-form__terms {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.register-form__terms input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-teal);
  flex-shrink: 0;
}

.register-form__terms a {
  color: var(--color-teal);
  font-weight: 600;
  text-decoration: none;
}

.register-form__terms a:hover {
  text-decoration: underline;
}

.login-card__brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.login-card__brand-text {
  min-width: 0;
}

.login-card__title {
  margin: 0 0 var(--space-1);
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 700;
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-card__sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.login-locale {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-password-wrap .form-field__input {
  width: 100%;
  padding-inline-end: 48px;
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: 6px;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
  background: var(--surface-sunken);
  color: var(--color-navy);
  outline: none;
}

.login-password-toggle[aria-pressed="true"] {
  color: var(--color-teal);
}

.login-password-toggle__icon {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}

.login-password-toggle__icon[hidden] {
  display: none !important;
}

.login-card__footer {
  margin: var(--space-5) 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.login-card__footer a {
  margin-inline-start: 4px;
  color: var(--color-teal);
  font-weight: 600;
  text-decoration: none;
}

.login-card__footer a:hover {
  text-decoration: underline;
}

@keyframes login-card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .login-card--register .login-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .register-form__grid,
  .register-form__uploads {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .login-page {
    align-items: flex-start;
    padding: 16px 12px 24px;
  }

  .login-card,
  .login-card--register {
    width: 100%;
    max-width: 100%;
  }

  .login-form {
    gap: var(--space-3);
  }

  .login-password-toggle {
    width: 44px;
    height: 44px;
  }

  .signup-upload__file {
    max-width: 48%;
  }
}

@media (max-height: 720px) {
  .login-page {
    align-items: flex-start;
    padding-top: 16px;
    padding-bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-card {
    animation: none;
  }
}
